package com.example.mygreendao;

import android.app.Application;
import android.database.sqlite.SQLiteDatabase;

import com.example.mygreendao.Dao.DaoMaster;
import com.example.mygreendao.Dao.DaoSession;

public class MyApp extends Application {
    @Override
    public void onCreate() {
        super.onCreate();
        CalendarOpenHelper devOpenHelper = new CalendarOpenHelper(this, "test.db");
        SQLiteDatabase writableDatabase = devOpenHelper.getWritableDatabase();
        DaoMaster daoMaster = new DaoMaster(writableDatabase);
        daoSession = daoMaster.newSession();
    }
    private DaoSession daoSession;

    public DaoSession getDaoSession() {
        return daoSession;
    }
}
